class Solution(object):
    def Power(self, base, exponent):
        """
        :type base: float
        :type exponent: int
        :rtype: float
        """
        if base == 0 or exponent < -1e9 or exponent > 1e9:
            return 0
        if exponent == 0:
            return 1
        
        if exponent > 0:
            res = 1 
            for i in range(exponent):
                res *= base
            return res
        elif exponent < 0:
            res = 1 
            for i in range(-exponent):
                res *= base
            return 1 / res